package cn.edu.whut.commonapi.core.error;

public enum CommonErrorCodes implements ErrorCode{

    SUCCESS(0, "成功"),

    PARAM_ERROR(400, "参数错误"),

    NOT_FOUND(404, "未找到资源"),

    UNAUTHORIZED(401, "未授权"),

    FORBIDDEN(403, "禁止访问"),

    NOT_IMPLEMENTED(501, "未实现"),

    SERVICE_UNAVAILABLE(503, "服务不可用"),

    GATEWAY_TIMEOUT(504, "网关超时");

    private int code;

    private String msg;

    CommonErrorCodes(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String msg() {
        return this.msg;
    }
}
